<?php

namespace App\Http\Requests\Front;

use App\Http\Requests\Request;

class UserLoginRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'user_name'=>'required|exists:user,user_name',
            'password'=>'required'
        ];
    }

    public function messages(){
        return [
            'user_name.required'=>'请输入您的手机或邮箱或账号',
            'user_name.exists'=>'用户不存在',
            'password.required'=>'请输入您的密码'
        ];

    }
}
